<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('manager/table_pdf_index/')?>" class="report">表与PDF对应关系</a></li>
				
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
			<form id="form" method="POST" action="<?=site_url('manager/table_pdf_create/')?>">
			<fieldset>
			<legend>添加新纪录</legend>
			<label>文档中文名称：</label><input type="text" name="doc_cn_name"  /> <br />
			<label>文档英文名称：</label><input type="text" name="doc_en_name"  /> <br />
			<label>分类：</label><select name="base_category"><?php foreach($base_category as $k => $v){?><option value="<?= $k?>"><?= $v?></option><?php }?></select>
			<br />
			<label>对应的表名：</label><input type="text" name="table_name"  /> <br />
			<label>对应的PDF名：</label><input type="text" name="pdf_name"  /> <br />
			<input id="button1" type="submit" value="添加" />
			</fieldset>
			</form>
			</div>
			
			<div id="box">
			  <table width="100%">
				<thead>
				  <tr>
					<th>ID.</th>
					<th>文档中文名</th>
					<th>文档英文名</th>
					<th>表名</th>
					<th>pdf文件名</th>
					<th>分类</th>
					<th>Action</th>
				  </tr>
				</thead>
				<tbody>
				<?php
				  $alt = true; 
				  foreach($lists as $item):
					$alt = !$alt;
				?>
				  <tr class="<?= ($alt)?'odd':'even'?>">
					<td><?= $item->id?></td>
					<td><?= $item->doc_cn_name?></td>
					<td><?= $item->doc_en_name?></td>
					<td><?= $item->table_name?></td>
					<td><?= $item->pdf_name?></td>
					<td><?= $base_category[$item->base_category]?></td>
					<td>
						<!--<a href="#"><img src="images/icons/page_white_link.png" title="Show" /></a>-->
						<a href='<?=site_url("manager/table_pdf_detail/$item->id")?>' rel="update"><img src="images/icons/page_white_edit.png" title="Edit" /></a>
						<!--<a href="#"><img src="images/icons/page_white_delete.png" title="Delete" /></a>-->
					</td>
				  </tr>
				  <?php endforeach;?>

				</tbody>
			  </table>
			</div>
		</div>
		<div id="sidebar">
			<ul>
				<li>
					<h3><a class="manage">Manage</a></h3>
					<ul>
						<li>表与PDF的对应关系说明</li>
						<li>表内有些字段是直接与程序和已经打印关联，非请勿动。</li>
					</ul>
				</li>
			</ul>
		</div>
	</div>

	<script type="text/javascript">
	$().ready(function() {
	  $("#form").validate({
		rules: {
			doc_cn_name:{
			 required:true,
			 rangelength:[2,100]
			},
			doc_en_name:{
			 required:true,
			 rangelength:[2,100]
			},
			base_category:{
			 required:true
			},
			table_name:{
			 required:true,
			 rangelength:[2,100]
			},
			pdf_name:{
			 required:true,
			 rangelength:[2,100]
			}
		}
	  });

	  $("a[rel='update']").colorbox({width:"98%", height:"95%", iframe:true});
	});
	</script>
	
<?=$this->load->view('include_footer',null)?>
